package utils;

import java.util.HashMap;

public class ServiceResponse {
	private int serviceResponseId;
	private boolean errorHappend;
	private int errorId;
	private String message;
	private boolean operationFinished;
	private int entityId;

	private final String serviceResponce = "serviceResponce";
	
	private final String serviceResponceIdNameAtr = "serviceResponceId";
	private final String errorHappendNameAtr = "errorHappend";
	private final String errorIdNameAtr = "errorId";
	private final String operationFinishedNameAtr = "operationFinished";
	private final String messageNameAtr = "message";
	private final String entityIdNameAtr = "entityId";

	public String getID() {
		return String.valueOf(serviceResponseId);
	}

	public String getType() {
		return serviceResponce;
	}

	public String[] getAllAttributes(){
		String[] result={serviceResponceIdNameAtr, errorHappendNameAtr, errorIdNameAtr, operationFinishedNameAtr, messageNameAtr,entityIdNameAtr};
		return result;
	}

	public HashMap<String, String[]> getAllValuesForAttributes(){
		HashMap<String, String[]> result= new HashMap<String, String[]>();
		String[] values;
		
		values=new String[1];
		values[0]=String.valueOf(getserviceResponseId());
		result.put(serviceResponceIdNameAtr, values);
		
		values=new String[1];
		values[0]=Boolean.toString(isErrorHappend());
		result.put(errorHappendNameAtr, values);
		
		values=new String[1];
		values[0]=String.valueOf(getErrorId());
		result.put(errorIdNameAtr, values);
		
		values=new String[1];
		values[0]=String.valueOf(getEntityId());
		result.put(entityIdNameAtr, values);
		
		values=new String[1];
		values[0]=getMessage();
		result.put(messageNameAtr, values);
		
		values=new String[1];
		values[0]=Boolean.toString(isOperationFinished());
		result.put(operationFinishedNameAtr, values);
		return result;
	}

	
	
	public int getserviceResponseId() {
		return serviceResponseId;
	}

	public void setserviceResponseId(int serviceResponseId) {
		this.serviceResponseId = serviceResponseId;
	}

	public boolean isErrorHappend() {
		return errorHappend;
	}

	public void setErrorHappend(boolean errorHappend) {
		this.errorHappend = errorHappend;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public boolean isOperationFinished() {
		return operationFinished;
	}

	public void setOperationFinished(boolean operationFinished) {
		this.operationFinished = operationFinished;
	}

	public int getErrorId() {
		return errorId;
	}

	public void setErrorId(int errorId) {
		this.errorId = errorId;
	}

	public int getEntityId() {
		return entityId;
	}

	public void setEntityId(int entityId) {
		this.entityId = entityId;
	}

}
